<? if(!defined('IN_TIPASK')) exit('Access Denied'); include template('header'); ?>
<link rel="stylesheet" href="<?=SITE_URL?>css/common/imgpopup/imgpopup.css"/>
<script src="<?=SITE_URL?>js/imgpopup.js" type="text/javascript"></script>
<div class="content">
    <div class="uleft">
        <div class="tximg"><img width="100px" height="100px" src="<?=$user['avatar']?>" alt="<?=$user['username']?>" title="<?=$user['username']?>"></div>
        <div class="txname">
            <?=$user['username']?>
            <? if($user['islogin']) { ?>            <img src="<?=SITE_URL?>css/default/online.gif" align="absmiddle" title="当前在线" alt="当前在线"/>
            <? } else { ?>            <img src="<?=SITE_URL?>css/default/outline.gif" align="absmiddle" title="当前离线" alt="当前离线"/>
            <? } ?>        </div>
        <div class="clr"></div>
        <div class="list">
            <h1><a title="我的主页" target="_top" href="<?=SITE_URL?>?user/score.html"><img width="16" height="16" align="absmiddle" src="<?=SITE_URL?>css/default/myhome.gif" /> &nbsp;我的主页</a></h1>
            <h1><a title="我的问答" target="_top" href="<?=SITE_URL?>?user/ask/2.html"><img width="16px" height="15px" align="absmiddle" src="<?=SITE_URL?>css/default/myanswer.gif" /> &nbsp;我的问答</a></h1>
            <h1  class="on"><a title="我的消息" target="_top" href="<?=SITE_URL?>?message/new.html"><img width="16px" height="16px" align="absmiddle" src="<?=SITE_URL?>css/default/mymsg.gif" /> &nbsp;我的消息</a></h1>
            <ul id="huida">
                <li id="hui1" <? if('outbox' != $type) { ?>class="ac"<? } ?>><a title="我的提问" target="_top" href="<?=SITE_URL?>?message/new.html">收件箱</a></li>
                <li id="hui2" <? if('outbox' == $type) { ?>class="ac"<? } ?> ><a title="我的回答" target="_top" href="<?=SITE_URL?>?message/outbox.html">已发送</a></li>
            </ul>
            <h1 class=""><a title="我收藏的问题" target="_top" href="<?=SITE_URL?>?user/favorite.html"><img width="14" height="15" align="absmiddle" src="<?=SITE_URL?>css/default/mycollect.gif" /> &nbsp;我的收藏</a></h1>
        </div>
    </div>
    <div class="uright">
        <div class="miaoshu">
            <img width="12px" height="12px" align="texttop" src="<?=SITE_URL?>css/default/tip1.gif"> 为了让您的提问被更多人关注，以获得最佳的回答，您可以提高悬赏。
        </div>

        <? if('outbox' == $type) { ?>        <div class="jianjie">&nbsp;已发送</div>
        <div class="fg"><img width="780px;" height="6px" src="<?=SITE_URL?>css/default/gx.gif"></div>
        <div class="wdhd2">
            <ul class="bt">
                <li class="b5">&nbsp;&nbsp;<input class="checkbox" id="chkall" onclick="checkall('mid[]')" type="checkbox" name="chkall">删</li>
                <li class="bt6">标题（共<?=$messagenum?>条）</li>
                <li class="b4">收件人</li>
                <li class="b4">日期</li>
            </ul>
            <form name="msgform" method="POST">
                <input type="hidden" name="type" value="out" />
                
<? if(is_array($messagelist)) { foreach($messagelist as $message) { ?>
                <ul>
                    <li class="b5"><input type="checkbox" name="mid[]" value="<?=$message['id']?>"></li>
                    <li class="b6"><a href="<?=SITE_URL?>?message/ajaxview/<?=$message['id']?>.html" title="<?=$message['subject']?>"><? echo cutstr($message['subject'],52) ?></a></li>
                    <li class="b4"><a target="_blank" href="<?=SITE_URL?>?u-<?=$message['fromuid']?>.html"><?=$message['touser']?></a></li>
                    <li class="b4"><?=$message['time']?></li>
                </ul>
                
<? } } ?>
                <ul>
                    <li class="b6">&nbsp;&nbsp;<input type="button" class="button1" value="删除消息" onclick="delmsg();"/></li>           
                </ul>
            </form>
        </div> 
        <? } else { ?>        <div class="tab2" id="tab">
            <ul>
                <li <? if('new'==$type) { ?>class="on"<? } ?>>
                    <a href="<?=SITE_URL?>?message/new.html">未读消息</a>
                </li>
                <li <? if('personal'==$type) { ?>class="on"<? } ?>>
                    <a href="<?=SITE_URL?>?message/personal.html">个人消息<?=$personalnum?></a>
                </li>
                <li <? if('system'==$type) { ?>class="on"<? } ?>>
                    <a href="<?=SITE_URL?>?message/system.html">系统消息<?=$systemnum?></a>
                </li>
            </ul>
            <div class="clr"></div>
        </div>
        <div class="wdhd2">
            <ul class="bt">
                <li class="b5">&nbsp;&nbsp;<input class="checkbox" id="chkall" onclick="checkall('mid[]')" type="checkbox" name="chkall">删</li>
                <li class="b5">状态</li>
                <li class="bt6">标题（共<?=$messagenum?>条）</li>
                <li class="b4">发件人</li>
                <li class="b4">日期</li>
            </ul>
            <form name="msgform" method="POST">
                <input type="hidden" name="type" value="in" />
                
<? if(is_array($messagelist)) { foreach($messagelist as $message) { ?>
                <ul>
                    <li class="b5"><input type="checkbox" name="mid[]" value="<?=$message['id']?>"></li>
                    <li class="b5"><? if($message['new']) { ?><img src="<?=SITE_URL?>css/default/newmsg.gif" title="未读"  class="noteicon" /><? } else { ?><img src="<?=SITE_URL?>css/default/readmsg.gif" title="已读" class="noteicon"/><? } ?></li>
                    <li class="b6"><a href="<?=SITE_URL?>?message/ajaxview/<?=$message['id']?>.html" title="<?=$message['subject']?>"><? echo cutstr($message['subject'],52) ?></a></li>
                    <li class="b4"><a target="_blank" href="<?=SITE_URL?>?u-<?=$message['fromuid']?>.html"><?=$message['from']?></a></li>
                    <li class="b4"><?=$message['time']?></li>
                </ul>
                
<? } } ?>
                <ul>
                    <li class="b6">&nbsp;&nbsp;<input type="button" class="button1" value="删除消息" onclick="delmsg();"/></li>           
                </ul>
            </form>
        </div>
        <? } ?>        <div class="blank20"></div>
        <div class="pages"><div class="scott"><?=$departstr?></div></div>
    </div>
</div>
<div class="clr"></div>
<script type="text/javascript">
    function delmsg(){
        document.msgform.action="index.php?message/remove<?=$setting['seo_suffix']?>";
        document.msgform.submit();
    }
    $(document).ready(function(){
       $(".b6 a").fancybox({'titlePosition':'false'});
    });
</script>
<? include template('footer'); ?>
